package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingProjectPageQueryDto;
import com.zzyl.entity.NursingProject;
import com.zzyl.vo.NursingProjectVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingProjectMapper {

    //添加数据
    void insert(NursingProject nursingProject);

    //分页条件查询
    Page<NursingProjectVo> pageQuery(NursingProjectPageQueryDto dto);

    //根据id查询
    @Select("select * from nursing_project where id = #{id}")
    NursingProject getById(Long id);

    //修改
    void update(NursingProject nursingProject);

    //删除
    @Delete("delete from nursing_project where id = #{id}")
    void delete(Long id);

    //查询所有
    @Select("select * from nursing_project where status = 1 order by order_no" )
    List<NursingProject> findAll();
}